package com.lp.bean;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@JsonSerialize(include = JsonSerialize.Inclusion.ALWAYS)
@EqualsAndHashCode(callSuper = false)
public class MenuInfo extends BaseBean{

    private String name;

    private String path;

    private Integer add_id;

    private Date add_time;

    private String icon;

    private Integer sort;

    private Integer hide;

    private String component;

    private Integer pid;

    private Date update_time;

    private String title;

    private Integer disable;

    private Integer keepAlive;

    private Integer affix;

    private String link;

    private Integer iframe;

    private List<MenuInfo> children = new ArrayList<>(); // 确保初始化;

    private Meta meta;

    // 添加子菜单
    public void addChild(MenuInfo child) {
        this.children.add(child);
    }
}
